package com.gochic;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;

import javax.jdo.annotations.Column;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.Inheritance;
import javax.jdo.annotations.InheritanceStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(detachable = "true")
@Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
public abstract class DataEntity implements Serializable {
	private static final long serialVersionUID = 7541114692351751984L;

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    @Column(name="id", jdbcType="BIGINT")
	private int id;
	
	@Persistent
    @Column(name="edit_time", jdbcType="TIMESTAMP")
	private Date editTime;

	public int getId() {
		return id;
	}

	public Date getEditTime() {
		return editTime;
	}

	public void setEditTime(Date editTime) {
		this.editTime = editTime;
	}

	public void setEditTime() {
		this.editTime = Calendar.getInstance().getTime();
	}
}